<template>
  <view class="my-order bg-nav-bar-1">
    <NavBar showBack title="我的订单"></NavBar>
    <scroll-view class="scroll-v" scroll-y @scrolltolower="loadPagingMore" @refresherrefresh="initPagingQuery"
      refresher-enabled :refresher-triggered="pagingInfo.loading">
      <OrderItem v-for="(itm) in pagingInfo.list" :key="itm.id" :detail="itm"></OrderItem>
      <NoData :list="pagingInfo.list" title="暂无订单数据" :loading="pagingInfo.loading" :total="pagingInfo.total" />
    </scroll-view>
  </view>
</template>


<script setup>
import NavBar from "@/components/ui/nav-bar"
import NoData from "@/components/tool/no-data"
import OrderItem from "./com/order-item"
import service from "@/path/service"
import { usePagingQuery } from "@/path/hooks";
function getOrderList(params) {
  return service.get("api/ycg/usercenter/orderlist", params)
}
const { pagingInfo, initPagingQuery, loadPagingMore } = usePagingQuery(getOrderList, { pageSize: 4 })
initPagingQuery()
</script>

<style lang="less" scoped>
@import url(./index.less);
</style>

